package com.t8;

/**
 * Created by xuyiwei on 2018/7/19.
 */
enum Note{
    MIDDLE_C,C_SHARP,B_FLAT;
}

class Instrument{
    public void play(Note n){
        System.out.println("Instrument play()");
    }
}

class Wind extends Instrument{
    public void play(Note n){
        System.out.println("Wind play()");
    }
}

class Wind2 extends Instrument{
    public void play(Note n){
        System.out.println("Wind2 play()");
    }
}


public class Music2 {
    public Music2() {
    }

    public static void tune(Instrument i){
        i.play(Note.B_FLAT);
    }

    public static void  main(String[] args) {
        Music2 music2 = new Music2();
        Wind w = new Wind();
        Music2.tune(w);
//        music2.tune(w);
        Wind2 w2 = new Wind2();
//        music2.tune(w2);
    }

}
